package com.fivestar.finance.app;

import android.app.Application;

import com.fivestar.finance.app.injector.components.ApplicationComponent;
import com.fivestar.finance.app.injector.components.DaggerApplicationComponent;
import com.fivestar.finance.app.injector.module.ApplicationModule;
import com.fivestar.finance.library.utils.logger.Logger;


/**
 * 简要描述
 *
 * @author Derek.Kidd
 * @version V1.0.0
 * @date 2016/8/16 16:37
 */
public class FFApplication extends Application {

    private ApplicationComponent mApplicationComponent;

    @Override
    public void onCreate() {
        super.onCreate();
        Logger.init();
        initComponent();

//        Glide.get(this)
//                .register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory());

//        LeakCanary.install(this);
    }

    private void initComponent() {
        mApplicationComponent =
                DaggerApplicationComponent.builder().applicationModule(new ApplicationModule(this)).build();
        mApplicationComponent.inject(this);
    }

    public ApplicationComponent getApplicationComponent() {
        return mApplicationComponent;
    }

}
